﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sanguosha.Core
{
    /// <summary>
    /// 卡牌的花色及点数
    /// </summary>
    public class ColorMark
    {
        int colorValue = 1;

        /// <summary>
        /// 花色类型
        /// </summary>
        public ColorTypes ColorType { get; set; }

        /// <summary>
        /// 点数
        /// </summary>
        public int ColorValue
        {
            get { return colorValue; }
            set
            {
                if (value < 1 || value > 13)
                    throw new ArgumentOutOfRangeException("value", value, "卡牌点数必须在1~13之间。");
                else colorValue = value;
            }
        }

        public override string ToString()
        {
            string[] colorTypeString = new string[] { "♥", "♦", "♠", "♣" };
            string[] colorValueString = new string[] { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" };
            return colorTypeString[(int)ColorType] + " " + colorValueString[ColorValue];
        }
    }
}
